package com.gome.ocean.service.authority;

import java.util.List;

import com.github.pagehelper.Page;
import com.gome.ocean.common.exception.ProjectServiceException;
import com.gome.ocean.dao.model.authority.ProjectBO;

/**
 * Created by liuqingxia on 2016/3/1.
 */
public interface ProjectService {

    /**
     * 新增一个项目组
     * 
     * @param projectBO
     * @return
     */
    public boolean insertProject(ProjectBO projectBO) throws ProjectServiceException;

    /**
     * 删除一个项目组
     * 
     * @param id
     * @return
     */
    public boolean removeProjectById(Long id) throws ProjectServiceException;

    /**
     * 更新一个项目组
     * 
     * @param projectBO
     * @return
     */
    public boolean updateProject(ProjectBO projectBO) throws ProjectServiceException;

    /**
     * 根据id查找项目组
     * 
     * @param id
     * @return
     */
    public ProjectBO findProjectById(Long id) throws ProjectServiceException;

    /**
     * 分页查找项目组
     * 
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Page<ProjectBO> findAllProjects(int pageNum, int pageSize) throws ProjectServiceException;

    /**
     * 根据项目组名查找项目组
     * 
     * @param projectName
     * @return
     */
    public ProjectBO findProjectByName(String projectName);

    /**
     * 根据项目组名查找项目组
     * 
     * @param projectName
     * @return
     */
    public List<ProjectBO> findProjectByNames(List<String> projectNames);

    /**
     * 查询用户所在的项目组
     * 
     * @param userEmail
     * @return
     */
    public List<ProjectBO> findProjectByUser(String userEmail) throws ProjectServiceException;

    public List<ProjectBO> getAllProjects();

    public List<ProjectBO> findAllProjectByCurrentEmail(String email);

}
